package com.seecen.letao.controller;

import com.seecen.letao.pojo.forumPojo.Article;
import com.seecen.letao.service.forumService.ForumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * 描述:
 *
 * @author 陈浩文
 * @create 2020-01-09 15:09
 */
@Controller
public class ForumController {

    @Autowired
    private ForumService forumService;

    @GetMapping("/forum")
    public String index(ModelMap map, HttpSession session){
        List<Article> articles = forumService.selectAll();
        map.put("articles",articles);
        return "/index.html";
    }

    @GetMapping("/forum2")
    public String hello2(){
        return "/article_detail.html";
    }
}
